package org.icy.core.loaders;

import java.util.HashMap;
import java.util.Map;

import org.icy.exceptions.IcySetupException;

public class ClassLoaderFactory {
	
	private static Map<String, ClassLoader> classLoaders = new HashMap<String, ClassLoader>();
	
	public static ClassLoader getClassLoader(String type) throws IcySetupException {
		if (!classLoaders.containsKey(type))	{
			throw new IcySetupException("ClassLoader type not bound: "+type);
		}
		return classLoaders.get(type);
	}
	
	public static void bindClassLoader(String type, ClassLoader cl) {
		classLoaders.put(type, cl);
	}
}
